﻿using System;
using hr_1.Model;

namespace hr_1.ViewModel
{
    class PositionViewModel : ViewModelBase
    {
        #region Fields

        readonly PositionClass _position = new PositionClass();

        #endregion // Fields

        #region Constructor

        public PositionViewModel() { }

        public PositionViewModel(PositionClass position)
        {
            if (position == null)
                throw new ArgumentNullException("position");

            _position = position;
        }

        #endregion // Constructor

        #region position Properties

        public string Name
        {
            get { return _position.name; }
            set
            {
                if (value == _position.name)
                    return;
                _position.name = value;
                base.OnPropertyChanged("Name");
            }
        }

        public string Department
        {
            get { return _position.department; }
            set
            {
                if (value == _position.department)
                    return;
                _position.department = value;
                base.OnPropertyChanged("Department");
            }
        }

        public string PositionGroup
        {
            get { return _position.position_group; }
            set
            {
                if (value == _position.position_group)
                    return;
                _position.position_group = value;
                base.OnPropertyChanged("PositionGroup");
            }
        }

        public string Salary
        {
            get { return _position.salary; }
            set
            {
                if (value == _position.salary)
                    return;
                _position.salary = value;
                base.OnPropertyChanged("Salary");
            }
        }
        #endregion // workActivity Properties
    }
}
